package com.jt.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: taoyi
 * @date: 2021/6/19 11:16
 * @version: 1.0
 * @explain:
 */
@RestController
@CrossOrigin
public class PortController {

    @Value("${server.port}")
    private Integer port;

    /**
     * 需求：要求通过 getPort() 方法动态获取当前端口号信息
     */
    @GetMapping("/getPort")
    public String getPort(){
        return "当前端口号:"+port;
    }

}
